package com.burgeon.backend.SHOPBACKEND.rest.openCardTask.util;
/**
 * 刷新开卡任务
 */

import com.burgeon.backend.Rest.base.RESTBase;
import org.json.JSONArray;
import org.springframework.util.MultiValueMap;

import java.util.HashMap;

public class FirstTaskView extends RESTBase {

    private String ip;
    private String account;
    private String password;

    public FirstTaskView(String ip, String account, String password) {
        this.ip = ip;
        this.account = account;
        this.password = password;
    }

    public void getData() throws Exception{
        String url = "http://"+ip+"/servlets/binserv/Rest";

        String str = RESULT(Data(),url);

        String  code = new JSONArray(str).getJSONObject(0).getString("code");

        /*if (!"0".equals(code)) {
           throw new Exception(str);
        }*/

    }

    private MultiValueMap Data() {
        HashMap params = new HashMap();

        params.put("webaction","C_STOREODMARK_GENERATE");
        params.put("id","0");

        return DATA("ExecuteWebAction", params,account,password);
    }

    public static void main(String[] args) {
        FirstTaskView g = new FirstTaskView("39.104.73.78:5321","nea@burgeon.com.cn","burgeon5321");
        try {
            g.getData();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.err.println();

    }
}
